package com.xi.controller;

import com.xi.pojo.PageResult;
import com.xi.pojo.ReservationQueryParam;
import com.xi.pojo.Result;
import com.xi.service.ReservationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/reservation")
public class ReservationController {

    @Autowired
    private ReservationService reservationService;

    /*
    * 分页查询预约信息
    * */
    @GetMapping
    public Result page(ReservationQueryParam reservationQueryParam) {
        log.info("预约信息分页查询 , {}", reservationQueryParam);
        PageResult pageResult = reservationService.page(reservationQueryParam);
        return Result.success(pageResult);
    }
}
